package com.leyou.item.pojo.api;


import com.leyou.item.pojo.Category;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@RequestMapping("category")
public interface CategoryApi {

    @GetMapping("names")
    ResponseEntity<List<String>> queryNameByIds(@RequestParam("ids") List<Long> ids);

    /**
     * 根据id查询分类名称
     *
     * @param id
     * @return
     */
    @GetMapping
    Category queryCategoryById(@RequestParam("id") Long id);

    @RequestMapping("list")
    List<Category> queryCategoryListByParentId(@RequestParam(value="pid" ,defaultValue = "0") Long pid);
}
